# Contributor: Coco Liliace <coco@liliace.dev>
# Maintainer: Coco Liliace <coco@liliace.dev>
pkgname=xremap-wlr
pkgver=0.10.2
pkgrel=0
pkgdesc="Key remapper for Wayland"
url="https://github.com/k0kubun/xremap"
# nix
# loongarch64: libc crate fails to build
arch="all !s390x !riscv64 !loongarch64"
license="MIT"
makedepends="cargo cargo-auditable"
replaces="xremap-sway"
source="$pkgname-$pkgver.tar.gz::https://github.com/k0kubun/xremap/archive/v$pkgver.tar.gz"
builddir="$srcdir/xremap-$pkgver"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release --features wlroots
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 -t "$pkgdir"/usr/bin ./target/release/xremap
}

sha512sums="
519f28fe31512fb5f4a2e637064d71fef174593e5660565b25d38b12bb0abac882d39a3a42eefd5749ff5a6792da8e7cc65c10038d462729a1055834a44dad02  xremap-wlr-0.10.2.tar.gz
"
